/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-04 11:25:22
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-04 19:13:27
 * @别瞎看: 你个无脑牛马
 */
import java.util.Arrays;
public class Test02_ArrayUtil{
    public static void main(String[] args) {
        int[] array={1,2,3,4,5,6,7,8};
        //获得数组字符串的输出
        String arrayStr=Arrays.toString(array);
        System.out.println("arrayStr:"+arrayStr);
        System.out.println("array.length:"+array.length);//8
        //拷贝数组
        array = Arrays.copyOf(array, 10);
        System.out.println("array.length:"+array.length);//10
        System.out.println("Arrays.toString:"+Arrays.toString(array));//.......8,0,0  新存入两个0

        //数组排序
        // 按大小
        // int[] arr1=new int[]{1,3,5,2,4,6};
        // Arrays.sort(arr1);
        // System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));
        //按名称
        // String[] arr2={"1","2","3","10","20","30","36","26"};
        // Arrays.sort(arr2);
        // System.out.println("Arrays.toString(arr2):"+Arrays.toString(arr2));
        //
        int[] arr3={1,3,5,2,4,6,7,8,9,10};
        System.out.println("Arrays.toString:"+Arrays.toString(arr3));
        Arrays.fill(arr3,3,5,10);
        System.out.println("Arrays.toString:"+Arrays.toString(arr3));
        


    }
}